package com.jwds.digital.bios.business.rpc.feign;

import com.jwds.digital.bios.business.core.infrastructure.dto.feign.BasicDeviceReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.vo.feign.BasicDeviceRespVO;
import com.jwds.digital.bios.business.rpc.feign.fallback.BasicDeviceFeignFallBack;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 设备基本信息Feign
 *
 * @Author hesong
 */
@FeignClient(name = "bios-flow", path = "/basic/device", fallback = BasicDeviceFeignFallBack.class)
public interface BasicDeviceFeign {

    /**
     * 根据id查询
     *
     * @param id 数据ID
     * @return BaseResponse
     */
    @GetMapping("/{id}")
    BaseResponse<BasicDeviceRespVO> queryById(@PathVariable("id") Long id);

    /**
     * 列表查询
     *
     * @param reqDto 请求参数
     * @return BaseResponse
     */
    @PostMapping("/all")
    BaseResponse<List<BasicDeviceRespVO>> list(@RequestBody BasicDeviceReqDTO reqDto);
}
